<template>
  <div class="box-item">
    <div class="boxs-top">
      <div class="title-pa-box">
        <titles :title="props.info.text" />
      </div>
      <textMax :maxLen="80" :data="props.info.remarks" />
    </div>
    <div class="box-content">
      <div class="box-img" v-for="item in props.info.children" :key="item.id">
        <img
          @click="pathChild(item)"
          class="box-img-i"
          :src="urls + item.value + '?imageView2/1/w/340/h/340/format/webp'"
          alt=""
          v-if="item.value"
        />

        <img
          @click="pathChild(item)"
          class="box-img-i"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_340,w_340"
          alt=""
          v-else
        />
        <div class="text-box" @click="pathChild(item)">
          <span
            class="title"
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ item.text }}</span
          >
          <span
            class="left-title1"
            :style="{
              fontSize: store.styleInfo.contentSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ item.remarks }}</span
          >
        </div>
      </div>

      <!-- <img
        v-for="item in props.info.children"
        :key="item.id"
        class="box-img"
        src="http://101.34.143.36:8890/api/image/387939155165253"
        alt=""
      /> -->
    </div>
  </div>
</template>

<script setup lang="ts">
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
  },
});
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.box-item {
  display: flex;
  width: 100%;
}
.boxs-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 50px;
  padding-right: 50px;
  min-width: 285px;
  .title {
    margin-bottom: 100px;
  }
}

.box-content {
  display: flex;
  flex-wrap: wrap;
  width: 680px;
  // height: 680px;
}
.box-img {
  position: relative;
  width: 50%;
  height: 340px;
}
.text-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  .title {
  }
  .left-title1 {
    line-height: 28px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden; //溢出内容隐藏
    text-overflow: ellipsis; //文本溢出部分用省略号表示
    display: -webkit-box; //特别显示模式
    -webkit-line-clamp: 3; //行数
    line-clamp: 3;
    -webkit-box-orient: vertical; //盒子中内容竖直排列
  }
}
.box-img:hover {
  .text-box {
    opacity: 1;
  }
}
.box-img-i {
  width: 100%;
  height: 340px;
}
.title-pa-box {
  margin-bottom: 100px;
}
</style>
